package Demo6;

public class Demo6 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
            while(true) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            }
        },"我的线程");

        System.out.println(t.getState());
        t.start();
        System.out.println(t.getState());
        t.join(60000);
        System.out.println(t.getState());

    }
}
